export const statusEnums = {
  1: '在职',
  2: '离职'
}
export const statusList = [
  { label: '在职', value: 1 },
  { label: '离职', value: 2 }
]

/** 表单 */
export const formData = {
  name: '',
  status: ''
}
export const formConfig = [
  {
    type: 'select',
    prop: 'name',
    label: '姓名',
    span: 4,
    placeholder: '请输入姓名',
    clearable: true,
    filterable: true,
    options: []
  },
  {
    type: 'select',
    prop: 'select',
    label: '在职状态',
    span: 4,
    clearable: true,
    isEnum: true,
    options: statusEnums
  }
]
/** 表格 */
const dateColumns = new Array(12).fill('').map((item, index) => {
  return {
    label: `${index + 1}月`,
    prop: `month${index + 1}`
  }
})
export const tableColumns = [
  {
    label: '姓名',
    prop: 'name'
  },
  ...dateColumns,
  {
    label: '合计',
    prop: 'total'
  },
  {
    label: '操作',
    prop: 'operation',
    slotName: 'operation'
  }
]

/** 新增 编辑 */
const dateOptions = dateColumns.map((item, index) => {
  return {
    ...item,
    value: index + 1
  }
})
export const aFormData = {
  name: '',
  month: 1,
  value: ''
}
export const aFormConfig = [
  {
    type: 'select',
    prop: 'name',
    label: '选择人员',
    span: 24,
    clearable: true,
    options: []
  },
  {
    type: 'select',
    prop: 'month',
    label: '选择月份',
    span: 24,
    options: dateOptions
  },
  {
    type: 'input',
    prop: 'value',
    label: '工时',
    span: 24
  }
]
export const aFormRules = {
  name: [{ required: true, message: '请选择人员', trigger: 'change' }],
  month: [{ required: true, message: '请选择月份', trigger: 'blur' }],
  value: [{ required: true, message: '请输入工时', trigger: 'blur' }]
}
